package com.int_tech.MessageCodeAll.dao;

import com.int_tech.MessageCodeAll.entity.CodeA0New;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

/**
 * Created by liubochao on 2018/7/14.
 */
public interface CodeA0NewDao extends JpaRepository<CodeA0New,Integer> {
    CodeA0New findByDataString(String dataString);

    Page<CodeA0New> findByStatus(Pageable pageRequest, int i);

    Page<CodeA0New> findByCheckStatus(Pageable pageRequest, int i);

    Page<CodeA0New> findByCheckStatusAndCarNumber(Pageable pageRequest, int i, String s);

    Page<CodeA0New> findByCheckStatusAndStatus(Pageable pageRequest, int i, int i1);

    List<CodeA0New> findByRateDateString(String rateDataString);

    List<CodeA0New> findByRateDateStringAndCheckStatus(String rateDataString, int i);

    Page<CodeA0New> findByCheckStatusAndStatusAndCreatedTimeAfter(Pageable pageRequest, int i, int i1, Date date);

    @Query("select s from CodeA0New s where s.dataString like CONCAT('%',?1,'%') ")
    CodeA0New findByDataStringLike(String rateDataString);

    CodeA0New findByOpenNumber(String mid);

    CodeA0New findByCloseNumber(String mid);
}
